#pragma once

#include <iostream>
#include <string>
#include <functional>
#include <strings.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "Log.hpp"
#include "InertAddr.hpp"
#include "MyCommon.hpp"
using namespace LogModule;
using func_t = std::function<void(int sockfd,const std::string &,InertAddr &)>;

const int defaultfd = -1;

class TcpServer : public NoCpy
{
private:
    int _sockfd;
    uint16_t _port;
    bool _isruning;

    func_t _func;

public:
    TcpServer(uint16_t port, func_t func)
        : _sockfd(defaultfd),
          _port(port),
          _isruning(false),
          _func(func)
    {
    }
    void Init()
    {
        _sockfd=socket(AF_INET,SOCK_STREAM,0);
        if(_sockfd<0)
        {
             
        }
    }
    void Run()
    {}

};
